﻿@model MyMvcStoreApplication.Models.Album

@{
    ViewBag.Title = "Crear album";
    var urlUnknownAlbum = Url.Content("~/Content/Images/unknown_album.jpg");
}

<h2>@ViewBag.Title</h2>

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
<script type="text/javascript">
    $(function () {
        $("#loadimg").click(function () {
            var urlTapaAlbum = $("#TapaAlbumURL").attr("value");
            if (urlTapaAlbum == null || urlTapaAlbum == "") {
                urlTapaAlbum = "@urlUnknownAlbum";
            }
            $("#imgminiatura").attr("src", urlTapaAlbum);
        });
    }
    )
</script>

@using (Html.BeginForm()) {
    @Html.ValidationSummary(true)
    <fieldset>
        @Html.Partial("EditView", Model)
        <p>
            <input type="submit" value="Crear" />
        </p>
    </fieldset>
}

<div>
    @Html.ActionLink("Volver a la lista", "Index")
</div>
